package com.bestcem.xm.deliver.controller;

import com.bestcem.xm.component.security.annotation.AuthIgnore;
import com.bestcem.xm.deliver.grpc.client.AwardGrpcClient;
import com.bestcem.xm.deliver.grpc.client.dto.AwardDto;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/deliver/test/")
public class DeliverTestController {

    private @NonNull AwardGrpcClient awardGrpcClient;

    @AuthIgnore
    @GetMapping("/getaward/")
    public String getAward() {
        final AwardDto award = awardGrpcClient.getAward("64c28e8af995e530365968f6", false);
        log.error(award.getName());
        return "award";
    }

}
